<?php
/**
 * Unfuddle Page Model
 *
 * @package     Unfuddle
 * @subpackage  Data Models
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: Page.php 27 2011-01-15 10:33:26Z luke.visinoni $
 */
class Unfuddle_Model_Page extends Unfuddle_Model_Abstract {

    protected $_name = 'page';
    
    protected $_fields = array (
        'author-id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'body' => array('type' => 'text', 'required' => false, 'read-only' => false),
        'body-format' => array('type' => 'set', 'required' => false, 'read-only' => true, 'set' => array('markdown', 'textile', 'plain')),
        'body-formatted' => array('type' => 'text', 'required' => false, 'read-only' => true), // only available if formatted=true
        'created-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
        'id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'message' => array('type' => 'text', 'required' => false, 'read-only' => false),
        'message-formatted' => array('type' => 'text', 'required' => false, 'read-only' => true), // only available if formatted=true
        'notebook-id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'number' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'title' => array('type' => 'text', 'required' => false, 'read-only' => false),
        'updated-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
        'version' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        /**
         * This is not an actual attribute, but when updating a page,
         * including this boolean and setting it to true will cause the
         * page to be overwritten as a minor change.
         */
        'minor' => array('type' => 'boolean', 'required' => false, 'read-only' => false),
    );

}